package edu.pku.sei.transformation.qvt.adapter.standardqvt;

import edu.pku.sei.transformation.editor.model.variable.ConnectionVariable;
import edu.pku.sei.transformation.qvt.rule.IConnectionTemplate;
import edu.pku.sei.transformation.qvt.rule.IObjectTemplate;

public class ConnectionTemplateAdapter implements IConnectionTemplate {
	protected ConnectionVariable element;
	protected IObjectTemplate source;
	protected IObjectTemplate target;

	public ConnectionTemplateAdapter(ConnectionVariable v) {
		element = v;
	}

	@Override
	public IObjectTemplate getSource() {
		return source;
	}

	@Override
	public String getSourceRoleName() {
		return element.getSourceRole();
	}

	@Override
	public IObjectTemplate getTarget() {
		return target;
	}

	@Override
	public String getTargetRoleName() {
		return element.getTargetRole();
	}

	@Override
	public String getContent() {
		return getTargetRoleName() + "=" + target.getContent();
	}

}
